﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <style>
        html, body {
            height: 100%;
            width: 100%;
            padding: 0px;
            margin: 0px;
        }

        #map {
            position: absolute;
            top: 0px;
            bottom: 0px;
            left: 0px;
            right: 0px;
            overflow: hidden;
        }
    </style>
</head>
<body onload="init()">
    <div id="map">
        <object id="TBAX" style="width: 100%; height: 100%"
            classid="clsid:B23DDF84-B652-4E34-9E57-77B8731199FE">
        </object>
    </div>
</body>
</html>
<script src="config/config.js"></script>
<script type="text/javascript"></script>
<script src="js/jquery.min.js"></script>
<script src="js/menu.js"></script>
<script>
    var sgworld;
    var username = "";
    var url = window.location.href;
    url = url.substring(0, url.lastIndexOf("/"));
    function init() {
        setTimeout(function () {
            // 
            sgworld = TBAX.createSgworld();
            sgworld.AttachEvent("OnLoadFinished", LoadFinished);
            sgworld.Open(fly);
            globe = TBAX.createMultScreen();
            globe.Open(fly);
        }, 1000);
    }
    function LoadFinished() {
        TBAX.setOpacity(1);//设置透明度，一定要在地球加载完成之后，菜单生成之前设置好
        setLogo();
        setlable();
        //添加菜单按钮
        setMenu(url);
    }
    function setLogo() {
        TBAX.setLogo("{'url':'" + url + "/image/logo.png','width':'743','height':'95','left':'0','top':'-15','horizontal':'left'}", "2");
        TBAX.setImg1("{'url':'" + url + "/image/top.png','width':'1920','height':'110','left':'0','top':'0','right':'-1','bottom':'-1','stretch':'2'}");
    }
    //获取页面信息
    function getcode() {
        username = window.localStorage.getItem('username');
        if(username == null) {
            window.navigate("http://localhost:5500/login.html"); 
        }
    }
    function setlable() {
        getcode();
        var labeljson = "[{'name':'lbl1','content':'" + username + "','fontsize':'20','rgba':'255,255,255,255','left':'-1','right':'150','top':'15','bottom':'-1'},{'name':'lbl2','content':'2020年2月19日','fontsize':'20','rgba':'255,255,255,255','left':'-1','right':'130','top':'75','bottom':'-1'},{'name':'lbl3','content':'','fontsize':'20','rgba':'255,255,255,255','left':'-1','right':'35','top':'75','bottom':'-1','istime':'true','format':'HH:mm:ss'}]";
        TBAX.setLabel(labeljson);
    }
    //获取功能数据
    function getMenu() {
        var tMenu = {
            "panels": [{
                "children": [{
                    "title": "菜单",
                    "callBack": "doSetm",
                    "icon": url + "/image/open.png",
                    "param": "2",
                    "height": 115,
                    "width": 270
                }],
                "left": 775,
                "title": "open",
                "top": -1,
                "bottom": 0,
                "right": -1,
                "visible": "false",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "用户信息",
                    "callBack": "",
                    "icon": url + "/image/toolR1.png",
                    "param": "",
                    "height": 44,
                    "width": 44
                }],
                "left": -1,
                "title": "yh",
                "top": 12,
                "bottom": -1,
                "right": 84,
                "visible": "true",
                "direction": "wh"
            }]
        };
        //测试
        $.ajax({
            url: 'http://192.168.1.38:31200/menu?id=1',
            type: 'post',
            async: false,
            success: function (data) {
                var gt = tMenu;
                var left = 820;
                if (data.length > 0) {
                    var dat = data[0];
                    if (dat.userModule == "true") {
                        var cans = {
                            "children": [{
                                "title": "用户管理",
                                "callBack": "doop",
                                "icon": url + "/image/menu1.png",
                                "param": "1",
                                "height": 63,
                                "width": 70
                            }],
                            "left": left,
                            "title": "cp",
                            "top": 3,
                            "bottom": -1,
                            "right": -1,
                            "visible": "true",
                            "direction": "wh"
                        };
                        left = left + 120;
                        tMenu.panels.push(cans);
                    } else if (dat.Information == "true") {
                        var cans = {
                            "children": [{
                                "title": "信息模型",
                                "callBack": "doop",
                                "icon": url + "/image/menu2.png",
                                "param": "2",
                                "height": 63,
                                "width": 70
                            }],
                            "left": left,
                            "title": "yy",
                            "top": 3,
                            "bottom": -1,
                            "right": -1,
                            "visible": "true",
                            "direction": "wh"
                        };
                        left = left + 120;
                        tMenu.panels.push(cans);
                    } else if (dat.dscene == "true") {
                        var cans = {
                            "children": [{
                                "title": "三维场景",
                                "callBack": "doop",
                                "icon": url + "/image/menu3.png",
                                "param": "3",
                                "height": 63,
                                "width": 70
                            }],
                            "left": left,
                            "title": "jk",
                            "top": 3,
                            "bottom": -1,
                            "right": -1,
                            "visible": "true",
                            "direction": "wh"
                        };
                        left = left + 120;
                        tMenu.panels.push(cans);
                    } else if (dat.modelManagement == "true") {
                        var cans = {
                            "children": [{
                                "title": "模块管理",
                                "callBack": "doop",
                                "icon": url + "/image/menu4.png",
                                "param": "4",
                                "height": 63,
                                "width": 70
                            }],
                            "left": left,
                            "title": "zljc",
                            "top": 3,
                            "bottom": -1,
                            "right": -1,
                            "visible": "true",
                            "direction": "wh"
                        };
                        left = left + 120;
                        tMenu.panels.push(cans);
                    } else if (dat.Visualization == "true") {
                        var cans = {
                            "children": [{
                                "title": "可视化",
                                "callBack": "doop",
                                "icon": url + "/image/menu5.png",
                                "param": "5",
                                "height": 63,
                                "width": 70
                            }],
                            "left": left,
                            "title": "yxjk",
                            "top": 3,
                            "bottom": -1,
                            "right": -1,
                            "visible": "true",
                            "direction": "wh"
                        };
                        left = left + 120;
                        tMenu.panels.push(cans);
                    } else if (dat.dataManagement == "true") {
                        var cans = {
                            "children": [{
                                "title": "数据管理",
                                "callBack": "doop",
                                "icon": url + "/image/menu6.png",
                                "param": "5",
                                "height": 63,
                                "width": 70
                            }],
                            "left": left,
                            "title": "xtgl",
                            "top": 3,
                            "bottom": -1,
                            "right": -1,
                            "visible": "true",
                            "direction": "wh"
                        };
                        left = left + 120;
                        tMenu.panels.push(cans);
                    } else if (dat.externalManagement == "true") {
                        var cans = {
                            "children": [{
                                "title": "外部管理",
                                "callBack": "doop",
                                "icon": url + "/image/menu6.png",
                                "param": "6",
                                "height": 63,
                                "width": 70
                            }],
                            "left": left,
                            "title": "xtgl",
                            "top": 3,
                            "bottom": -1,
                            "right": -1,
                            "visible": "true",
                            "direction": "wh"
                        };
                        left = left + 120;
                        tMenu.panels.push(cans);
                    }
                    //子菜单
                    if (dat.menu.userModule) {
                        if (dat.menu.userModule.length > 0) {
                            var lis = {
                                "children": [],
                                "left": 15,
                                "title": "c1",
                                "top": 75,
                                "bottom": -1,
                                "right": -1,
                                "visible": "false",
                                "direction": "wh"
                            };
                            for (var j = 0; j < dat.menu.userModule.length; j++) {
                                var zicd = {
                                    "title": dat.menu.userModule[j].title,
                                    "callBack": dat.menu.userModule[j].callback,
                                    "icon": url + dat.menu.userModule[j].icon,
                                    "param": dat.menu.userModule[j].param,
                                    "height": 30,
                                    "width": 40
                                }
                                lis.children.push(zicd);
                            }
                            tMenu.panels.push(lis);
                        }
                    } else if (dat.menu.Information) {
                        if (dat.menu.Information.length > 0) {
                            var lis = {
                                "children": [],
                                "left": 15,
                                "title": "c2",
                                "top": 75,
                                "bottom": -1,
                                "right": -1,
                                "visible": "false",
                                "direction": "wh"
                            };
                            for (var j = 0; j < dat.menu.Information.length; j++) {
                                var zicd = {
                                    "title": dat.menu.Information[j].title,
                                    "callBack": dat.menu.Information[j].callback,
                                    "icon": url + dat.menu.Information[j].icon,
                                    "param": dat.menu.Information[j].param,
                                    "height": 30,
                                    "width": 40
                                }
                                lis.children.push(zicd);
                            }
                            tMenu.panels.push(lis);
                        }
                    } else if (dat.menu.dscene) {
                        if (dat.menu.dscene.length > 0) {
                            var lis = {
                                "children": [],
                                "left": 15,
                                "title": "c3",
                                "top": 75,
                                "bottom": -1,
                                "right": -1,
                                "visible": "false",
                                "direction": "wh"
                            };
                            for (var j = 0; j < dat.menu.dscene.length; j++) {
                                var zicd = {
                                    "title": dat.menu.dscene[j].title,
                                    "callBack": dat.menu.dscene[j].callback,
                                    "icon": url + dat.menu.dscene[j].icon,
                                    "param": dat.menu.dscene[j].param,
                                    "height": 30,
                                    "width": 40
                                }
                                lis.children.push(zicd);
                            }
                            tMenu.panels.push(lis);
                        }
                    } else if (dat.menu.modelManagement) {
                        if (dat.menu.modelManagement.length > 0) {
                            var lis = {
                                "children": [],
                                "left": 15,
                                "title": "c4",
                                "top": 75,
                                "bottom": -1,
                                "right": -1,
                                "visible": "false",
                                "direction": "wh"
                            };
                            for (var j = 0; j < dat.menu.modelManagement.length; j++) {
                                var zicd = {
                                    "title": dat.menu.modelManagement[j].title,
                                    "callBack": dat.menu.modelManagement[j].callback,
                                    "icon": url + dat.menu.modelManagement[j].icon,
                                    "param": dat.menu.modelManagement[j].param,
                                    "height": 30,
                                    "width": 40
                                }
                                lis.children.push(zicd);
                            }
                            tMenu.panels.push(lis);
                        }
                    } else if (dat.menu.Visualization) {
                        if (dat.menu.Visualization.length > 0) {
                            var lis = {
                                "children": [],
                                "left": 15,
                                "title": "c5",
                                "top": 75,
                                "bottom": -1,
                                "right": -1,
                                "visible": "false",
                                "direction": "wh"
                            };
                            for (var j = 0; j < dat.menu.Visualization.length; j++) {
                                var zicd = {
                                    "title": dat.menu.Visualization[j].title,
                                    "callBack": dat.menu.Visualization[j].callback,
                                    "icon": url + dat.menu.Visualization[j].icon,
                                    "param": dat.menu.Visualization[j].param,
                                    "height": 30,
                                    "width": 40
                                }
                                lis.children.push(zicd);
                            }
                            tMenu.panels.push(lis);
                        }
                    } else if (dat.menu.dataManagement) {
                        if (dat.menu.dataManagement.length > 0) {
                            var lis = {
                                "children": [],
                                "left": 15,
                                "title": "c6",
                                "top": 75,
                                "bottom": -1,
                                "right": -1,
                                "visible": "false",
                                "direction": "wh"
                            };
                            for (var j = 0; j < dat.menu.dataManagement.length; j++) {
                                var zicd = {
                                    "title": dat.menu.dataManagement[j].title,
                                    "callBack": dat.menu.dataManagement[j].callback,
                                    "icon": url + dat.menu.dataManagement[j].icon,
                                    "param": dat.menu.dataManagement[j].param,
                                    "height": 30,
                                    "width": 40
                                }
                                lis.children.push(zicd);
                            }
                            tMenu.panels.push(lis);
                        }
                    } else if (dat.menu.externalManagement) {
                        if (dat.menu.externalManagement.length > 0) {
                            var lis = {
                                "children": [],
                                "left": 15,
                                "title": "c7",
                                "top": 75,
                                "bottom": -1,
                                "right": -1,
                                "visible": "false",
                                "direction": "wh"
                            };
                            for (var j = 0; j < dat.menu.externalManagement.length; j++) {
                                var zicd = {
                                    "title": dat.menu.externalManagement[j].title,
                                    "callBack": dat.menu.externalManagement[j].callback,
                                    "icon": url + dat.menu.externalManagement[j].icon,
                                    "param": dat.menu.externalManagement[j].param,
                                    "height": 30,
                                    "width": 40
                                }
                                lis.children.push(zicd);
                            }
                            tMenu.panels.push(lis);
                        }
                    }
                }
            },
            error: function (error) {
                console.log(error)
            }
        });

    }
    function setMenu1() {
        //
        var jurisdiction = Number(window.localStorage.getItem("jurisdiction"));
        //var form = new FormData();
        //form.append("id", 1);
        var tMenu = {
            "panels": [{
                "children": [{
                    "title": "菜单",
                    "callBack": "doSetm",
                    "icon": url + "/image/open.png",
                    "param": "2",
                    "height": 115,
                    "width": 270
                }],
                "left": 775,
                "title": "open",
                "top": -1,
                "bottom": 0,
                "right": -1,
                "visible": "false",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "用户信息",
                    "callBack": "",
                    "icon": url + "/image/toolR1.png",
                    "param": "",
                    "height": 44,
                    "width": 44
                }],
                "left": -1,
                "title": "yh",
                "top": 12,
                "bottom": -1,
                "right": 84,
                "visible": "true",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "用户管理",
                    "callBack": "doop",
                    "icon": url + "/image/menu1.png",
                    "param": "1",
                    "height": 63,
                    "width": 70
                }],
                "left": 820,
                "title": "cp",
                "top": 3,
                "bottom": -1,
                "right": -1,
                "visible": "true",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "信息模型",
                    "callBack": "doop",
                    "icon": url + "/image/menu2.png",
                    "param": "2",
                    "height": 63,
                    "width": 70
                }],
                "left": 940,
                "title": "yy",
                "top": 3,
                "bottom": -1,
                "right": -1,
                "visible": "true",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "三维场景",
                    "callBack": "doop",
                    "icon": url + "/image/menu3.png",
                    "param": "3",
                    "height": 63,
                    "width": 70
                }],
                "left": 1060,
                "title": "jk",
                "top": 3,
                "bottom": -1,
                "right": -1,
                "visible": "true",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "模块管理",
                    "callBack": "doop",
                    "icon": url + "/image/menu4.png",
                    "param": "4",
                    "height": 63,
                    "width": 70
                }],
                "left": 1180,
                "title": "zljc",
                "top": 3,
                "bottom": -1,
                "right": -1,
                "visible": "true",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "可视化",
                    "callBack": "doop",
                    "icon": url + "/image/menu5.png",
                    "param": "5",
                    "height": 63,
                    "width": 70
                }],
                "left": 1300,
                "title": "yxjk",
                "top": 3,
                "bottom": -1,
                "right": -1,
                "visible": "true",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "数据管理",
                    "callBack": "doop",
                    "icon": url + "/image/menu6.png",
                    "param": "5",
                    "height": 63,
                    "width": 70
                }],
                "left": 1420,
                "title": "xtgl",
                "top": 3,
                "bottom": -1,
                "right": -1,
                "visible": "true",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "外部管理",
                    "callBack": "doop",
                    "icon": url + "/image/menu6.png",
                    "param": "6",
                    "height": 63,
                    "width": 70
                }],
                "left": 1540,
                "title": "xtgl",
                "top": 3,
                "bottom": -1,
                "right": -1,
                "visible": "true",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "平移",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_03.png",
                    "param": "1050&0",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "旋转",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_05.png",
                    "param": "1057&0",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "指北",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_07.png",
                    "param": "1056&0",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "漫游",
                    "callBack": "roam",
                    "icon": url + "/image/twoimage/child14.png",
                    "param": "",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "文字标记",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_11.png",
                    "param": "1012&0",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "图片标记",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_13.png",
                    "param": "1012&1",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "线标记",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_15.png",
                    "param": "1012&4",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "矩形标记",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_17.png",
                    "param": "1012&6",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "圆形标记",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_19.png",
                    "param": "1012&9",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "箭头标记",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_21.png",
                    "param": "1012&8",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "长方体",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_23.png",
                    "param": "1012&18",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "圆柱体",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_36.png",
                    "param": "1012&20",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "箭头体",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_38.png",
                    "param": "1012&24",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "水平距离",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_41.png",
                    "param": "1034&0",
                    "height": 30,
                    "width": 40
                }, {
                    "title": "空间距离",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_40.png",
                    "param": "1035&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "垂直距离",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_42.png",
                    "param": "1036&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "地形面积测量",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_43.png",
                    "param": "1165&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "三维平面量测",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_50.png",
                    "param": "1037&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "日照分析",
                    "callBack": "Shadow",
                    "icon": url + "/image/twoimage/002_57.png",
                    "param": "1037&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "通视分析",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_52.png",
                    "param": "1046&3",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "视域分析",
                    "callBack": "syfx",
                    "icon": url + "/image/twoimage/002_54.png",
                    "param": "",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "最佳路径分析",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_55.png",
                    "param": "1042&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "洪水淹没分析",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_56.png",
                    "param": "1044&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "坡度坡向分析",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_71.png",
                    "param": "2217&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "地形开挖",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_73.png",
                    "param": "1012&16",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "地下模式",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_74.png",
                    "param": "1027&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "等高线生成",
                    "callBack": "UndergroundMode",
                    "icon": url + "/image/twoimage/002_72.png",
                    "param": "",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "工程树",
                    "callBack": "projectTree",
                    "icon": url + "/image/twoimage/002_64.png",
                    "param": "",
                    "height": 30,
                    "width": 30
                }],
                "left": 15,
                "title": "c3",
                "top": 75,
                "bottom": -1,
                "right": -1,
                "visible": "false",
                "direction": "wh"
            }, {
                "children": [{
                    "title": "碰撞检测",
                    "callBack": "g_execute",
                    "icon": url + "/image/twoimage/002_67.png",
                    "param": "1040&0",
                    "height": 30,
                    "width": 30
                }, {
                    "title": "卷帘对比",
                    "callBack": "RollerShutter",
                    "icon": url + "/image/twoimage/002_69.png",
                    "param": "",
                    "height": 30,
                    "width": 30
                }],
                "left": 15,
                "title": "c4",
                "top": 75,
                "bottom": -1,
                "right": -1,
                "visible": "false",
                "direction": "wh"
            }]
        };
        TBAX.setFullBtn2(JSON.stringify(tMenu));
    }
    function doSetm(type) {
        if (type == "1") {
            TBAX.setFullBtnVisibility("open", "true");
            TBAX.setFullBtnVisibility("close", "false");
            TBAX.setFullBtnVisibility("an1", "true");
            TBAX.setFullBtnVisibility("an2", "true");
            TBAX.setFullBtnVisibility("an3", "true");
            TBAX.setFullBtnVisibility("an4", "true");
            TBAX.setFullBtnVisibility("an5", "true");
            TBAX.setFullBtnVisibility("an6", "true");
        } else if (type == "2") {
            TBAX.setFullBtnVisibility("open", "false");
            TBAX.setFullBtnVisibility("close", "true");
            TBAX.setFullBtnVisibility("an1", "false");
            TBAX.setFullBtnVisibility("an2", "false");
            TBAX.setFullBtnVisibility("an3", "false");
            TBAX.setFullBtnVisibility("an4", "false");
            TBAX.setFullBtnVisibility("an5", "false");
            TBAX.setFullBtnVisibility("an6", "false");
        }
    }
    function doop(type) {
        if (type == "1") {
            TBAX.closeDialog("featureInfo");
            TBAX.createBorderDialog("userManage", url + "/html/Popup/userManage.html", 1600, 800, 120, 120, -1, -1);
            TBAX.setFullBtnVisibility("c3", "false");
            TBAX.setFullBtnVisibility("c4", "false");
        } else if (type == "2") {
            TBAX.closeDialog("userManage");
            TBAX.createBorderDialog("featureInfo", url + "/html/Popup/featureInfo.html", 1600, 800, 120, 120, -1, -1);
            TBAX.setFullBtnVisibility("c3", "false");
            TBAX.setFullBtnVisibility("c4", "false");
        } else if (type == "3") {
            TBAX.closeDialog("featureInfo");
            TBAX.closeDialog("userManage");
            TBAX.setFullBtnVisibility("c3", "true");
            TBAX.setFullBtnVisibility("c4", "false");
        } else if (type == "4") {
            TBAX.closeDialog("featureInfo");
            TBAX.closeDialog("userManage");
            TBAX.setFullBtnVisibility("c3", "false");
            TBAX.setFullBtnVisibility("c4", "true");
        } else if (type == "5") {
            TBAX.closeDialog("featureInfo");
            TBAX.closeDialog("userManage");
            //可视化
            ksh();
            // TBAX.closeDialog("title1");
            //TBAX.createBorderDialog("title1", url + "/html/Popup/homeInfo.html", 1600, 800, 120, 120, -1, -1);
            TBAX.setFullBtnVisibility("c3", "false");
            TBAX.setFullBtnVisibility("c4", "false");
        } else if (type == "6") {
            TBAX.closeDialog("featureInfo");
            TBAX.closeDialog("userManage");
            TBAX.setFullBtnVisibility("c3", "false");
            TBAX.setFullBtnVisibility("c4", "false");
        }
    }
    //可视化
    function ksh() {
        sgworld.window.SetInputMode(1, "", true);
        sgworld.AttachEvent("OnLButtonDown", select_OnLButtonDown);
        sgworld.AttachEvent("OnRButtonDown", select_OnRButtonDown);
    }
    function select_OnLButtonDown(flags, x, y) {
        //获取鼠标的世界坐标
        var startPosition = sgworld.window.PixelToWorld(x, y);
        var Sfeture;
        try {
            Sfeture = sgworld.ProjectTree.GetObject(startPosition.ObjectID);
            var leibie = Sfeture.FeatureAttributes.GetFeatureAttribute("类别").Value;
            var zlm = Sfeture.FeatureAttributes.GetFeatureAttribute("族名称").Value;
            var lxmc = Sfeture.FeatureAttributes.GetFeatureAttribute("类型名称").Value;
            //传递数据
            window.localStorage.setItem('leibie', leibie);
            window.localStorage.setItem('zlm', zlm);
            window.localStorage.setItem('lxmc', lxmc);
            TBAX.createBorderDialog("homeInfo", url + "/html/Popup/homeInfo.html", 1600, 800, 120, 120, -1, -1);
        } catch (e) {
            return;
        }
    }
    //数据详情
    function detailData() {
        TBAX.closeDialog("homeInfo");
    }
    function select_OnRButtonDown() {
        sgworld.window.SetInputMode(0);
        sgworld.DetachEvent("OnLButtonDown", select_OnLButtonDown);
        sgworld.DetachEvent("OnRButtonDown", select_OnRButtonDown);
    }
    //执行命令
    function g_execute(CommandID, parameters) {
        var itemId = sgworld.ProjectTree.FindItem("临时组");
        if (itemId == "") {
            itemId = sgworld.ProjectTree.CreateGroup("临时组");
        }
        sgworld.ProjectTree.SelectItem(itemId);
        try {
            if (parameters == "null")
                sgworld.Command.Execute(CommandID, null);
            else
                sgworld.Command.Execute(CommandID, parameters);
        } catch (e) {
            alert(e.message);
        }
    }
    //日照分析
    function Shadow() {
        SGWorld.Command.Execute(2118, 0);
        SGWorld.Command.Execute(1065, 4);
    }
    //视域分析
    function syfx() {
        var itemId = sgworld.ProjectTree.FindItem("临时组");
        if (itemId == "") {
            itemId = sgworld.ProjectTree.CreateGroup("临时组");
        }
        sgworld.ProjectTree.SelectItem(itemId);
        TBAX.createDialogDock("静态视域", getabspath("demo1/tool/3DViewshedonRoute/ViewshedTable.html"), 280, 400, -1, -1, 50, 50);
    }
    //工程树
    function projectTree() {
        TBAX.createDialogDock("工程树", url + "/html/projecttree.html", 280, 480, -1, -1, 50, 50);
    }
    //卷帘对比
    function RollerShutter() {
        TBAX.setShowMode(7);
        //var ImageComparisonPop = sgworld.Creator.CreatePopupMessage("卷帘对比", url + "/html/ImageComparisonPopup.html", 1, 1, 450, 120);
        //sgworld.Window.ShowPopup(ImageComparisonPop);
    }
    var dxms = 0;
    //地下模式
    function UndergroundMode() {
        if (dxms == 0) {
            dxms = 1;
            sgworld.Navigate.UndergroundMode = true;
        } else {
            dxms = 0;
            sgworld.Navigate.UndergroundMode = false;
        }
    }
    //漫游
    function roam() {
        var Path = "漫游\\演示工具";
        var itemId = sgworld.ProjectTree.FindItem(Path);
        if (itemId != "") {
            var obj = sgworld.ProjectTree.GetObject(itemId);
            if (obj.ObjectType == 34) {
                try {
                    obj.Play(0);
                } catch (e)
                { }
            }
        }
    }
</script>
